{include file="public/header" /}
<link rel="stylesheet" href="/static/index/css/draw.css">
<body class="hide-top bgc">
<div class="draw-container">
    <img src="/static/index/img/icon36.png" alt="">
    <div class="draw-content">
        <div class="earnings-content">
            <div class="earnings-hd flex-center">
                <i class="layui-icon layui-icon-left flex-center" onclick="history.go(-1)"></i>账户充值
                <div class="record" onclick="load_href('{:url(\'remit/record\')}',2)">
                    充值记录
                </div>
            </div>
        </div>
        <div class="draw-account-news" style="margin-top: 3.75rem">
            <div style="padding-top: 2rem">
                <ul class="recharge-nav flex-layout">
                    <li class="active" data-type="支付宝">
                        <p class="flex-center">
                            <img src="/static/index/img/alipay.png" alt="">
                        </p>
                        <p>支付宝支付</p>
                    </li>
                    <li data-type="微信">
                        <p class="flex-center">
                            <img src="/static/index/img/wechat.png" alt="">
                        </p>
                        <p>微信支付</p>
                    </li>
                    <li data-type="银行卡">
                        <p class="flex-center">
                            <img src="/static/index/img/bank.png" alt="">
                        </p>
                        <p>银行卡支付</p>
                    </li>
                </ul>
                <div style="padding-top: 1rem">
                    <div class="recharge-imgs alipay flex-center">
                        <p class="flex-center">
                            <img class="images" src="{:cache('system')['remit_alipay']}" alt="">
                        </p>
                        <p style="color: #aaaaaa">请扫码支付</p>
                    </div>

                    <div class="recharge-imgs wechat flex-center" style="display: none">
                        <p class="flex-center">
                            <img class="images" src="{:cache('system')['remit_wechat']}" alt="">
                        </p>
                        <p style="color: #aaaaaa">请扫码支付</p>
                    </div>

                    <div class="recharge-bank">
                        <p>
                            <span>
                                <span class="copy_content" >{:cache('system')['remit_bank_number']}</span>
                                <span class="copy" data-clipboard-action="copy" data-clipboard-target=".copy_content"
                                  style="color: red">复制</span>
                            </span>
                        </p>
                        <div style="padding-top: .3rem">
                            <p class="flex-center">
                                <img src="/static/index/img/bank.png" alt="">
                            </p>{:cache('system')['remit_bank_name']} | {:cache('system')['remit_bank_account']}
                        </div>
                    </div>
                </div>
                <form action="{:url('remit/save')}" method="post" class="form layui-form">
                    <input type="hidden" value="支付宝" id="pay_way" name="pay_way"/>
                    <ul class="recharge-acc-list">
                        <li>

                            <div>￥
                                <input type="text" lay-verify="required" lay-reqtext="请填写充值金额" lay-verType="tips"
                                       name="amount" placeholder="请填写充值金额，{:cache('system')['remit_min']}起充"
                                       autocomplete="off"
                                       onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
                            </div>
                        </li>
                        <li style="display: flex;align-items: center;justify-content: center;    flex-direction: column;">
                            <label id="uploads_image">
                                <img src="/static/index/img/addImg.png" alt="" id="image_show">
                            </label>
                            <p style="color: #aaaaaa">请上传支付凭证</p>
                            <input type="hidden" name="images" id="images_value" value="" lay-verify="required"
                                   lay-reqtext="请上传支付凭证"
                                   placeholder="请上传支付凭证"/>
                        </li>
                    </ul>

                    <p class="save upd-save" lay-submit lay-filter="save" formObj=".form">立即充值</p>
                    <div style="height: .1rem"></div>
                </form>

                <img alt="" style="display:none;width: 100%;height: auto" id="displayimg" src=""/>
            </div>
        </div>
    </div>
</div>
</body>
{include file="public/footer"/}
<script src="/static/index/js/clipboard.min.js"></script>
<script>
    $('.images').click(function () {
        DataHtml('收款码', $(this).attr('src'))
    });
    $('.copy').click(function () {
        var clipboard = new ClipboardJS('.copy');
        layer.msg('已复制');
    })
    $('.recharge-nav li').click(function (e) {
        if (e.currentTarget.dataset.type == '银行卡') {
            $('.recharge-bank').show()
            $('.alipay').hide()
            $('.wechat').hide()
        } else if (e.currentTarget.dataset.type == '支付宝') {
            $('.alipay').show()
            $('.wechat').hide()
            $('.recharge-bank').hide()
        } else {
            $('.alipay').hide()
            $('.wechat').show()
            $('.recharge-bank').hide();
        }
        $("#pay_way").val(e.currentTarget.dataset.type);
        $(this).addClass('active').siblings().removeClass('active')
        $(this).find('.img').show().parent().siblings().find('.img').hide()
    })

    function DataHtml(name, url) {
        $("#displayimg").attr("src", url);
        var height = $("#displayimg").height();
        var width = $("#displayimg").width();
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            shadeClose: true,
            area: [width + 'px', 'auto'], //宽高
            content: "<img style='width: 100%' alt=" + name + " title=" + name + " src=" + url + " />"
        });
    }
</script>
</html>